package net.oschina.archx.mybatis.model;

/**
 * 雇员实体
 * 
 * @author ArchX[archx@foxmail.com]
 */
public class Employee {
    private Long id;
    private String name;
    private Integer age;
    private Gender gender = Gender.Male;

    public static enum Gender {
        Male("男人"), Femal("女人");

        private final String info;

        private Gender(String info) {
            this.info = info;
        }

        public String getInfo() {
            return info;
        }
    }

    public Employee() {
        this(1L, "employee", 20, Gender.Male);
    }

    public Employee(Long id, String name, Integer age, Gender gender) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Gender getGender() {
        return gender;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "{ \"id\":" + this.id + ", \"name\":\"" + this.name + "\", \"age\":" + this.age + ", \"gender\":\"" + this.gender.info + "\" }";
    }

    
}
